#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
typedef int SeListDatatype;
void swap(SeListDatatype* p1, SeListDatatype* p2)
{
	SeListDatatype x = *p1;
	*p1 = *p2;
	*p2 = x;
}
typedef struct SeqListNode
{
	SeListDatatype* arr;
	int size;
	int capacity;
}SeqListNode;
SeqListNode* Initial()
{
	SeqListNode* S = (SeqListNode*)malloc(sizeof(SeqListNode));
	S->arr = NULL;
	S->capacity = 0;
	S->size = 0;
	return S;
}
void PushSeqL(SeqListNode* head, SeListDatatype x)
{
	if (head->capacity == head->capacity)
	{
		head->capacity = head->capacity == 0 ? 4 : 2 * head->capacity;
		head->arr = (SeListDatatype*)realloc(head->arr,sizeof(SeListDatatype) * head->capacity);
	}
	head->arr[head->size] = x;
	head->size++;
}
void Sort(SeqListNode* head)
{
	int x1 = 0;
	int x2 = head->size - 1;
	while (x1 <= x2)
	{
		if (head->arr[x1] % 2 == 0)
		{
			while(x2>=x1)
			{
				if (head->arr[x2] % 2 == 1)
				{
					swap(head->arr + x1, head->arr + x2);
					break;
				}
				x2--;
			}
		}
		x1++;
	}
}
int main()
{
	SeqListNode* S = Initial();
	while (1)
	{
		int x = 0;
		scanf("%d", &x);
		if (x == 0)
			break;
		else
		{
			PushSeqL(S, x);
		}
	}
	Sort(S);
	int i = 0;
	for (i; i < S->size; i++)
	{
		printf("%d ", S->arr[i]);
	}
}